package org.tea.inventory.enums;

import lombok.Getter;
import lombok.Setter;

import java.util.Objects;

/**
 * @author hanzy
 * @description 兑换方式
 * @date 2023年04月06日 14:03
 */
public enum MedalTypeEnum {
    ENTRYPERIOD("ENTRYPERIOD", "入职年限"),
    CERTIFICATE("CERTIFICATE", "证书上传"),
    DEPT_REWARD("DEPT_REWARD", "部门表彰"),
    COMPANY_TREWARD("COMPANY_TREWARD", "公司表彰"),
    CUSTOMER_TREWARD("CUSTOMER_TREWARD", "客户表彰"),
    TRAIN("TRAIN", "证书上传"),
    NEWYEAR("2024NEWYEAR", "2024新春徽章"),
    ;

    @Getter
    @Setter
    private String code;
    @Getter
    @Setter
    private String content;

    MedalTypeEnum(String code, String content) {
        this.code = code;
        this.content = content;
    }

    public static String getContentByName(String code) {
        for (MedalTypeEnum productAttributeEnum : MedalTypeEnum.values()) {
            if (Objects.equals(productAttributeEnum.getCode(), code)) {
                return productAttributeEnum.getContent();
            }
        }
        return "";
    }
}
